Migrate test suite from Hardhat to Foundry#2848
Merged
Merged
Conversation
Set up forge compilation for all 302 Solidity files alongside existing Hardhat config. Add foundry.toml with Soldeer deps (forge-std, OZ 4.4.2, Chainlink CCIP, LayerZero v2, solidity-bytes-utils) and transitive remappings for LZ dependency chain. Replace hardhat/console.sol import with forge-std/console2.sol in MockRebornMinter.
Add MockStrategy and MockNonRebasing state variables and imports to the shared Base contract so they are available to all test suites.
Shared.sol deploys OUSD + OUSDVault behind proxies, configures the vault with withdrawal delay, rebase rate max, and drip duration, then funds matt and josh with 100 OUSD each. Mint.t.sol covers mint, deprecated mint overload, mintForStrategy, burnForStrategy, and auto-allocate on mint (13 tests).
Cover governor(), isGovernor(), two-step transferGovernance + claimGovernance flow, and access control reverts (9 tests).
Cover totalValue, checkBalance, getAssetCount, getAllAssets, getStrategyCount, getAllStrategies, isSupportedAsset, and the deprecated oUSD() accessor (18 tests).
Cover all VaultAdmin setters, pause functions, strategy management, and token rescue. Includes revert paths for unauthorized callers, invalid values, and edge cases like "Asset not supported by Strategy", "Strategy has funds", and "Parameter length mismatch" (98 tests).
Cover rebase pausing, yield distribution to rebasing accounts, non-rebasing exclusion, trustee fee accrual, previewYield, drip duration smoothing, _nextYield early-return branches, and the defensive fee >= yield check (19 tests).
Cover allocate to default strategy, vault buffer, withdrawal queue reserves, depositToStrategy, withdrawFromStrategy, withdrawAllFromStrategy, withdrawAllFromStrategies, capital-paused revert, and early return when no asset available (23 tests).
Cover requestWithdrawal, claimWithdrawal, claimWithdrawals, addWithdrawalQueueLiquidity, strategy-queue interactions, mint-covers-outstanding scenarios, full drain edge cases, insolvency and slash scenarios, solvency at 3%/10% maxSupplyDiff, rebase-on-redeem, and capital-paused claims (55 tests).
Add test directory, solmate dependency, and remappings to foundry.toml. Add .gitkeep placeholders for the test directory structure. Add lcov.info to .gitignore.
Captures the established test conventions (directory layout, inheritance chain, naming patterns, helper idioms, fuzz config) so future contract test suites follow the same structure as OUSDVault.
Add fuzz tests for mint, rebase, and withdraw covering key properties (scaling, round-trip recovery, yield distribution, queue invariants). Configure foundry.toml with 1024 runs and deterministic seed.
…to 96% - Add Burn.t.sol and Initialize.t.sol for previously untested functions - Add missing revert tests to Mint, TransferFrom, Transfer, YieldDelegation - Fix truncated assertion in Mint.t.sol - Update unit-test skill to enforce one file per function rule
Enforce minimum coverage thresholds: 100% functions, 90% branches/lines/statements. Includes iterative improvement workflow and requires explanation for uncovered paths.
…onic, WrappedOusd) Add Foundry unit tests for remaining wrapped token variants and declare their state variables in Base.sol for shared test infrastructure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…r contracts Add comprehensive unit tests for OETHZapper, OETHBaseZapper, OSonicZapper, and WOETHCCIPZapper. Tests cover all public functions, revert conditions, event emissions, and edge cases. Uses vm.mockCall for CCIP router and vm.etch for hardcoded addresses (wS, Base WETH). 35 tests across 9 test suites — 100% line/statement/branch/function coverage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…% coverage Add 120 tests across 22 files covering CurvePoolBooster, CurvePoolBoosterPlain, and CurvePoolBoosterFactory. Includes concrete tests for all public/external functions and fuzz tests for fee handling and salt encoding. Also adds shared test infrastructure: Base.sol pool booster state vars, MockCreateX for deterministic CREATE2 testing, and naming convention rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unit tests for PoolBoosterMerkl and PoolBoosterFactoryMerkl covering constructor, bribe, isValidSignature, getNextPeriodStartTime, factory create/compute, and setMerklDistributor. Includes fuzz test for period timing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unit tests for PoolBoosterSwapxSingle, PoolBoosterSwapxDouble, and their factories. Covers constructor validation, bribe mechanics, split calculations, factory create/compute, and abstract factory functions (bribeAll, removePoolBooster). Includes fuzz test for double bribe split amounts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unit tests for PoolBoosterMetropolis and PoolBoosterFactoryMetropolis covering constructor, bribe mechanics with rewarder/voter mocking, and factory create/compute functions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…overage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensures forge excludes test helper files from coverage reports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…h 100% coverage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolves: - .github/workflows/defi.yml: keep deleted (replaced by foundry.yml) - contracts/dev.env: keep Foundry-oriented structure, preserve master's Automaton/nonce-queue vars and the still-live Hardhat vars, and document both the Foundry (FORK_BLOCK_NUMBER_*) and Hardhat (BLOCK_NUMBER) fork-block conventions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KQTR6rq3bhucMHXFoNXxJT
…s for WOETHPlume and WOSonic - Deleted unit tests for WOETHPlume: Deposit, ViewFunctions, and Shared utilities. - Deleted unit tests for WOSonic: Deposit, ViewFunctions, and Shared utilities. - Removed unused artifacts and references related to OSonic and WOETH in Proxies, Tokens, Vaults, Strategies, and Zappers. - Cleaned up PoolBoosters artifacts by removing obsolete factory references.
- Deleted OSonicOracleRouter.sol and OracleRouter.sol as they are no longer needed. - Removed related README.md files and SVG diagrams for OETH and Oracle routers. - Updated generate.sh script to exclude Oracle-related UML generation. - Cleaned up PlantUML files by removing references to obsolete Oracle components.
… PoolBoosterMerkl
…vailable and add isModuleAvailable flag in shared test
* migrate all of the talos actions to viem and away from hardhat * changing in place ethers references to remove hardhat * remove unneeded files
…time - getBlock/getDiffBlocks resolve the provider via tasks/lib/network for the standalone action CLI, with an hre fallback for legacy hardhat dev tasks - lazy-require @nomicfoundation/hardhat-network-helpers (mine) so importing block.js no longer loads hardhat; only advanceBlocks (test/dev) needs it - completes the Talos hardhat removal: block.js was the last module pulling hardhat onto the standalone action runtime path (tasks/lib/network merged via #2943) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* add test report * update test report * fix error message * add the easy tests * update decisions * test: cover OUSD delegation accounting and strategy config * test(origin): strengthen curve amo front-running coverage * feat(deploy): support Base and HyperEVM timelocks * docs: record foundry migration batch two * chore: update tests and defender action bundles * chore: ignore generated defender bundles * chore: match CI Forge formatting * chore: format auto withdrawal task * docs: record skip decisions in foundry migration open questions Mark #5 (Algebra/Hydrex AMO), #7 (RebalancerModule), #10 (legacy OUSD migration-state), #11 (whale withdrawAllFromStrategies) and #13 (WOETH-upgrade/EigenLayer/EIP-7702) as skipped; keeps Batch 2's #9 result. Open: #3, #4, #12. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(ssv): cover 21 validators with real beacon proofs * docs(gap): mark 21-validator SSV real-proof scenarios as closed Closed by 200e9cd (TwentyOneValidators.t.sol): the three multi-validator real-Beacon-proof scenarios now covered. strat-compounding-ssv 75->78 covered, 26->23 missing; Total 1071->1074 / 434->431. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Clément <clemmoller@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sparrowDom
previously approved these changes
Jul 22, 2026
sparrowDom
left a comment
Member
There was a problem hiding this comment.
A couple of comments inline otherwise LGTM
shahthepro
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the smart contract test and deployment validation workflow from Hardhat to Foundry.
Also adds a fresh OUSD core deployment and hardens Foundry governance simulation and transaction broadcasting for Prague.
Changes
DeployManagerandResolverto test deployed contracts with pending governance applied.VaultValueChecker.vm.roll, then restoring the active EVM version.--no-isolate, ensuring nonces remain sequential when contract creations and calls are interleaved.Foundry deployment notes
vm.roll. Large governance jumps therefore trigger thousands of RPC block-hash and storage reads. Governance simulation temporarily switches only the roll cheatcode to Cancun and immediately restores Prague; the skipped blocks' synthetic EIP-2935 history is intentionally not populated.--no-isolateso each captured transaction increments the deployer nonce before the next address is calculated.Test plan
make testmake test-smokeforge build scripts/deploy/make simulate